import { Outlet, useLocation, useNavigate } from "react-router-dom";
import { Tabs } from "antd";

const SearchList = () => {
    const navigate = useNavigate();
    const { pathname } = useLocation();
    function onChange(activeKey: any) {
        navigate(activeKey);
    }
    return (<div>
        <Tabs
            defaultActiveKey={pathname}
            items={[
                {
                    label: "文章",
                    key: "/list/search-list/articles",
                },
                {
                    label: "项目",
                    key: "/list/search-list/projects",
                },
            ]}
            onChange={onChange}
        />
        <hr />
        <Outlet />
    </div>
    )
};

export default SearchList;